package tds.study.nacos.payment.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author tds
 * @version 1.0.0
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName ConfigController
 * @Description TODO（这里用一句话描述这个类的作用)
 * @Date 2021-11-09 23:56
 */
@RestController
@RequestMapping("/config")
//@RefreshScope
public class ConfigController {

    @Value("${useLocalCache:false}")
    private boolean useLocalCache;

    @Value("${server.port}")
    private String serverPort;

    @RequestMapping("/serverPort")
    public String getPort() {
        return serverPort;
    }

    @RequestMapping("/get")
    public boolean get() {
        return useLocalCache;
    }
}
